﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeWork
{
    class Program
    {
        static void Main(string[] args)
        {
            //a为下限，b为上限
            int a = Convert.ToInt32(Console.ReadLine());
            int b = Convert.ToInt32(Console.ReadLine());

            string str = "";
            for(int i=a;i<=b;i++)
            {
                bool judge = true;//判断i是否是素数
                for(int j=2;j<i;j++)
                {
                    if(i%j==0)
                    {
                        judge = false;
                        break;
                    }
                }
                if(judge)//如果是素数，加到str中
                {
                    str = str + i + " ";
                }
            }
            //输出结果
            Console.WriteLine(str);
        }
    }
}
